<%--
  Created by IntelliJ IDEA.
  User: cyy
  Date: 2020/3/21
  Time: 23:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<c:set var="ctx" value="<%=basePath%>"  />
<html>
<head>
    <title>订单操作</title>
    <link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/toastr/toastr.min.css">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="/static/js/home/myreview.js"></script>
    <script src="/static/toastr/toastr.min.js"></script>

    <style type="text/css">
        span{
            color:#008000;
            font-weight: 900;
        }
        /*只显示纵向滑动条*/
        html { overflow-x: hidden; overflow-y: auto; }
        .row{
            margin-left: 30px;
        }
        .table-striped > tbody > tr:nth-of-type(odd){
            background-color: lavender;
        }
        .table>tbody>tr{
            height:60px;
        }
    </style>
    <script>
        var ctx='${ctx}'
    </script>
</head>
<body>
<div class="row">
    <div>
        <table  id="mytable" class="table table-striped table-hover table-condensed table-bordered">
            <thead>
            <tr>
                <th>酒店信息</th>
                <th>相关评论</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${pageInfo.list}" var="review">
                <tr class="infoPic" >
                    <td style="width: 25%">${review.hotelNameRoom}</td>
                    <td style="max-width:300px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden"  onmousemove="removeClassType(this)">${review.reviewAll}</td>
               
                        <%--  <td><fmt:formatDate value="${review.gmt_payment}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                          <td><fmt:formatDate value="${review.inTime}" pattern="yyyy-MM-dd"/></td>
                          <td><fmt:formatDate value="${review.outTime}" pattern="yyyy-MM-dd"/></td>--%>
                    <td>
                        <div class="btn-group">
                            <button type="button" class="btn btn-danger" onclick="deleteReview('${review.id}')" style="margin-left: 10px" data-toggle="modal" data-target="#deleteModal">删除</button>
                        </div>
                    </td>
                </tr>

            </c:forEach>
            </tbody>
        </table>
        <p>
            当前 <span>${pageInfo.pageNum}</span> 页,总 <span>${pageInfo.pages}</span> 页,共 <span>${pageInfo.total}</span> 条记录
        </p>
        <ul class="pagination">
            <li><a href="${ctx}homeHigh/myReview">第一页</a> </li>
            <c:choose>
                <c:when test="${pageInfo.hasPreviousPage == 'true'}">
                    <li><a href="${ctx}homeHigh/myReview?pageNum=${pageInfo.prePage}")>上一页</a></li>
                </c:when>
                <c:otherwise>
                    <li><a href="${ctx}homeHigh/myReview?pageNum=1">上一页</a></li>
                </c:otherwise>
            </c:choose>
            <c:choose>
                <c:when test="${pageInfo.hasNextPage == 'true'}">
                    <li><a href="${ctx}homeHigh/myReview?pageNum=${pageInfo.nextPage}">下一页</a></li>
                </c:when>
                <c:otherwise>
                    <li><a href="${ctx}homeHigh/myReview?pageNum=${pageInfo.pages}">下一页</a></li>
                </c:otherwise>
            </c:choose>
            <li><a href="${ctx}homeHigh/myReview?pageNum=${pageInfo.pages}">最后一页</a></li>
        </ul>
    </div>

    <%--删除模态框--%>
    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="deleteModalLaber">删除框</h4>
                </div>
                <div class="modal-body" id="active">
                    <input type="hidden" name="deleteId" id="deleteId"/>
                    <span> 确定删除吗?</span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="deleteActive">删除</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
